package p2000;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

public class Main2020绝对值排序 {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNextInt()) {
            int n = scanner.nextInt();

            if (n == 0) {
                break;
            }

            int[] arr = new int[n];
            List<Integer> list = new ArrayList<Integer>(n);
            for (int i = 0; i < n; i++) {
                int a = scanner.nextInt();
                if (a < 0) {
                    a = -a;
                    list.add(a);
                }
                arr[i] = a;
            }

            Arrays.sort(arr);

            for (int i = 0; i < arr.length - 1; i++) {
                int tmp = arr[arr.length - 1 - i];
                if (list.indexOf(tmp) != -1) {
                    tmp = -tmp;
                }
                System.out.print(tmp + " ");
            }
            System.out.println(arr[0]);
        }
    }

}
